package com.jz.digital.net;

import com.jz.digital.bean.BaseEntity;
import com.jz.digital.bean.UserInfo;
import com.jz.digital.listener.ApiCallback;
import com.google.gson.JsonObject;

import okhttp3.MediaType;
import okhttp3.RequestBody;

/**
 * ================================================
 * Created: WangYong
 * Date: 2024/11/24
 * Description:
 * ================================================
 */
public class AccountManager {
    /**
     * 登陆
     */
    public static void login(String account, String password, ApiCallback<BaseEntity<UserInfo>> callback) {
        JsonObject json = new JsonObject();
        json.addProperty("userId", account);
        json.addProperty("userKey", password);
        RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), json.toString());
        AccountApi.api.login(requestBody).enqueue(callback);
    }
}
